//
//  @ Project : Galaxy Star Trading System
//  @ File Name : TradeClientManager.h
//  @ Date : 2014/9/5
//  @ Author :
//
//


#if !defined(_CTRADE_CLIENT_MANAGER_H)
#define _CTRADE_CLIENT_MANAGER_H

#include "ProviderManager.h"

namespace GSTrader
{
	namespace TradeStrategy
	{
		class CFramework;
		class TRADE_STRATEGY_API CTradeProviderManager : public CProviderManager
		{
		public:
			CTradeProviderManager(CFramework* pFramework);
			virtual ~CTradeProviderManager();

			bool AddProvider(CProvider* pClient);

			void OnLogin(CAccountData* pAccountData);
			void OnLogout();

		
			CTradeProvider* GetProviderByID(int nProviderId);
			CTradeProvider* GetFirstProvider();
			CTradeProvider* GetProviderByAccount(string strInvestorID, string strBrokerId);

			void GetTradingProvider(vector<CTradeProvider*>& vTradeProvider, bool bTrading);
			void GetInstrumentProvider(int nInstrumentId, vector<CTradeProvider*>& vTradeProvider);

			CTradeProvider* ConnTradeServer(CConnectionInfo* pInfo);
		};
	}
}

#endif // _CTRADE_CLIENT_MANAGER_H


